<template>
    <div>
        <h1>users</h1>
        <ul>
            <li v-for="(user,index) in list" :key="index">{{user.name}}</li>
        </ul>
    </div>
</template>

<script>
export default {
  layout: "main",
  async fetch({ $axios, store }) {
    // console.log(context)
    const { data } = await $axios.get(
      "http://localhost:3001/user-list?pageSize=10"
    );
    store.commit("users/SET_LIST", data.data)
    // console.log(data);
  },
  computed:{
      ...mapState("users",["list"])
  }
};
</script>

<style scoped>
</style>